import { contextBridge } from 'electron'
import { electronAPI } from '@electron-toolkit/preload'
import shellApi from './api/shellApi'
import windowApi from './api/windowApi'
import ipcApi from './api/ipcApi'
import pathApi from './api/pathApi'
import nodeApi from './api/nodeApi'
import fileApi from './api/fileApi'
import notificationApi from './api/notificationApi'
import requestApi from './api/requestApi'
import damaApi from './api/damaApi'

try {
  contextBridge.exposeInMainWorld('electronApi', electronAPI)
  contextBridge.exposeInMainWorld('windowApi', windowApi)
  contextBridge.exposeInMainWorld('ipcApi', ipcApi)
  contextBridge.exposeInMainWorld('shellApi', shellApi)
  contextBridge.exposeInMainWorld('pathApi', pathApi)
  contextBridge.exposeInMainWorld('nodeApi', nodeApi)
  contextBridge.exposeInMainWorld('notificationApi', notificationApi)
  contextBridge.exposeInMainWorld('fileApi', fileApi)
  contextBridge.exposeInMainWorld('requestApi', requestApi)
  contextBridge.exposeInMainWorld('damaApi', damaApi)
} catch (error) {
  console.error('Failed to expose APIs:', error);
}